﻿@model SDSystem.Models.Restaurant
@{
    ViewBag.Title = "Restaurant Detais";
    Layout = "~/Views/Shared/_LayoutSite.cshtml";
}

<!DOCTYPE html>

<html>
    <head>
        <meta property="fb:app_id" content="186184241473914">
        <title>Details Restaurant</title>
        <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjU0EJWnWPMv7oQ-jjS7dYxSPW5CJgpdgO_s4yyMovOaVh_KvvhSfpvagV18eOyDWu7VytS6Bi1CWxw"
            type="text/javascript"></script>
        <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
        <script type="text/javascript">
            var map = null;
            var geocoder = null;

            function initialize() {
                if (GBrowserIsCompatible()) {
                    map = new GMap2(document.getElementById("map_canvas"));
                    map.setCenter(new GLatLng(37.4419, -122.1419), 1);
                    map.setUIToDefault();
                    geocoder = new GClientGeocoder();
                }
            }

            function showAddress(address) {
                if (geocoder) {
                    geocoder.getLatLng(
          address,
          function (point) {
              if (!point) {
                  alert(address + " not found");
              } else {
                  map.setCenter(point, 15);
                  var marker = new GMarker(point, { draggable: true });
                  map.addOverlay(marker);
                  GEvent.addListener(marker, "dragend", function () {
                      marker.openInfoWindowHtml(marker.getLatLng().toUrlValue(6));
                  });
                  GEvent.addListener(marker, "click", function () {
                      marker.openInfoWindowHtml(marker.getLatLng().toUrlValue(6));
                  });
                  GEvent.trigger(marker, "click");
              }
          }
        );
                }
            }
    </script>
    </head>
    <body onload="initialize()" onunload="GUnload()">
        <div class="row">
            <div class="span8">
                <div class="row">
                    <div class="span8">
                        <h3>Nhà hàng @Html.DisplayFor(m => m.Name)</h3>
                    </div>
                    <div class="span5">
                        <img src=@Html.DisplayFor(m=>m.Image) alt="@Html.DisplayFor(m=>m.Name)"/>
                    </div>
                    <div class="span3">
                        @Html.Raw(Model.Description)
                    </div>
                </div>
            </div>
            <div class="span8">
                @Html.Raw(Model.RContent)
                <i class="icon-home"></i><b>Địa chỉ:</b>
                <p>@Html.DisplayFor(m=>m.Street),@Html.DisplayFor(m=>m.City)</p>
                <i class="icon-map-marker"></i><b>Tìm trên bản đồ:</b>
            </div>
            <div class="span8">
                <div class="row">
                    <div class="span8">
                        <form onsubmit="showAddress(this.address.value); return false">
                            <input type="text" style="width:350px;margin: 0px" name="address" value="@ViewBag.MapsLocation">
                            <button type="submit" value="Go!" class="btn btn-primary">Go!</button>
                            <div id="map_canvas" style="width: 600px; height: 400px; position: relative; background-color: rgb(229, 227, 223);"></div>
                        </form>
                    </div>
                    <div class="span8">
                    <div id="fb-root" style="margin:0 auto;"></div>
                    <br/>
                        <fb:comments href="http://www.dantri.com.vn" num-posts="10" width="770px"></fb:comments>
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>

